﻿<%@ Page Title="" Language="C#" MasterPageFile="~/mpUser.master" AutoEventWireup="true" CodeFile="GerenciarJogador.aspx.cs" Inherits="GerenciarJogador" %>
<%@ MasterType VirtualPath="~/mpUser.master"  %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="chpConteudoUser" Runat="Server">
    <asp:HyperLink ID="hypNovoJogador" NavigateUrl="~/editJogador.aspx" runat="server">Novo Jogador</asp:HyperLink>
    
    <br />
    <br />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
        
            
            <asp:GridView ID="GridView1"  SkinID="MinhaPreferencia" 
            runat="server"
             DataSourceID="ObjectDataSource1" onrowdatabound="GridView1_RowDataBound" >
                <Columns>
                    <asp:TemplateField HeaderText="Id" SortExpression="Id">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Id") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("Id") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="Nome" HeaderText="Nome" SortExpression="Nome" />
                    <asp:TemplateField HeaderText="DataNascimento" SortExpression="DataNascimento">
                        
                        <ItemTemplate>
                        
                            <asp:Label ID="lblData" runat="server" Text='<%# Bind("DataNascimento", "{0:d}") %>' ></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField ShowHeader="False">
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                                CommandName="excluir"  CommandArgument='<%# Bind("Id") %>'  Text="Delete" 
                                onclick="LinkButton1_Click"></asp:LinkButton>
                            <asp:ConfirmButtonExtender ID="LinkButton1_ConfirmButtonExtender" 
                                runat="server" ConfirmText="Confirma a Exclusao?" Enabled="True" 
                                TargetControlID="LinkButton1">
                            </asp:ConfirmButtonExtender>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:HyperLinkField  DataNavigateUrlFields="Id" DataNavigateUrlFormatString="EditJogador.aspx?Id={0}" Text="Editar" /> 
                </Columns>
                
            </asp:GridView>
            <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
                SelectMethod="SelecionarTudo" TypeName="ControleCampeonato.BLL.JogadorBLL">
            </asp:ObjectDataSource>
        </ContentTemplate>
    </asp:UpdatePanel>
    <br />
    
</asp:Content>

